package models

import (
	"github.com/astaxie/beego"
	"github.com/astaxie/beego/orm"
	"time"
)

type IpccTtsInfo struct {
	//Id     int64  `orm:"pk"`
	TtsId  string `orm:"size(16);unique;column(ttsId);pk"`
	Name   string
	Update time.Time `orm:"auto_now;type(datetime)"`
}

func RegIpccTtsManager() {

	orm.RegisterModel(new(IpccTtsInfo))
}

func GetAllTtsInfo() (result []IpccTtsInfo, err error) {

	o := orm.NewOrm()
	o.Using("default")

	_, err = o.QueryTable("IpccTtsInfo").All(&result)
	if err != nil {
		beego.Error("query table err:%v", err)
		return result, err
	}

	return result, err
}
